package com.microservices.yucloud.appweb.disruptor;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * @author zy
 * @date 2019-09-05 20:24
 **/
@Slf4j
@Service
public class NotifyEventHandler implements EventHandler<NotifyEvent>, WorkHandler<NotifyEvent> {

    @Override
    public void onEvent(NotifyEvent notifyEvent, long l, boolean b) {
        log.info("接收到消息notifyEvent[{}],[{}],[{}]", notifyEvent, l, b);
        this.onEvent(notifyEvent);
    }

    @Override
    public void onEvent(NotifyEvent notifyEvent) {
        log.info(notifyEvent + ">>>" + UUID.randomUUID().toString());
    }

}
